package com.szrt.java.day20161226.demo13;

public class Demo {
	
	
	public static void main(String[] args) {
		//System.out.println(add(2,3));
		System.out.println(addGJ(1,2,3,4,5));
		
	}
	
	/**
	 * @param xs  本质是一个数组   int[]
	 * @return
	 */
	public static int addGJ(int... xs){
		int sum =0;
		int len = xs.length;
		for(int index = 0; index<=len-1; index++){
			int value = xs[index];
			sum =sum +value;
		}
		return sum;
	}
	
	public static int add(int x, int y){
		return x+y;
	}
	
	public static int add(int x, int y,int z){
		return x+y+z;
	}

}
